//
//  DZGuidePage.m
//  dzyc
//
//  Created by 蓝鳍互娱 on 2024/6/11.
//

#import "DZGuidePage.h"
#import "DZGuidePageView.h"
#import "AppDelegate.h"
@implementation DZGuidePage
static DZGuidePage *defaultManager = nil;
+ (DZGuidePage *)defaultManager{
    static dispatch_once_t token;
    dispatch_once(&token, ^{
        if(defaultManager == nil){
            defaultManager = [[self alloc] init];
        }
    });
    return defaultManager;
}
- (void)showGuidePage:(void (^)(void))ClearGuideBlock{
    if(!DZ_GETObject_UserDef(NSUserDefaults_First)){
        DZGuidePageView *guidePageView = [[DZGuidePageView alloc] init];
        [((AppDelegate*)[[UIApplication sharedApplication] delegate]).window.rootViewController.view addSubview:guidePageView];
        [guidePageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(@(DZRatio(0)));
        }];
        guidePageView.ClearGuideBlock = ^{
            ClearGuideBlock();
        };
    }
}
@end
